home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / telecomm / 515 / multi1_1 / multiple.spt next >
Text File  |  1991-10-21  |  11KB  |  233 lines

  1. ;**************************************************************
  2. SCRIPT 3 Download File(s) V 1.11
  3. ECHO OFF                               Don't display commands
  4. CLEAR                                  Clear the screen
  5. ;delete previous download error text file.
  6. IF EXIST "DLERROR.TXT"                 Does download error file exist?
  7.    ;If a default path is desired place the path in the above line and
  8.    ;below, an example is given.
  9.    ;Provide the same path everywhere in the Script (3 places).
  10.    ;ERASEFILE "DRIVE:\FOLDER1\FOLDER2\DLERROR.TXT"
  11.    ERASEFILE "DLERROR.TXT"             Erase error file
  12. ENDIF
  13. NOTE
  14. NOTE "                    Download File(s) Script"
  15. NOTE "                          Version 1.11"
  16. NOTE "                        by Fred H. Koch"
  17. NOTE "                            [F.KOCH]"
  18. NOTE "                          Modified By"
  19. NOTE "                            Rob Mann "
  20. NOTE "                            [R.MANN2]"
  21. NOTE "This Script will download one or more files by entering the file"
  22. NOTE "name or number.  Multiple files must be separated by commas."
  23. NOTE "The script will abort if a file is not found."
  24. NOTE " This Script has been modified to work on the new GEnie Library "
  25. NOTE " on Page 1075 for practice up and downloading."
  26. :ENTER_LIBRARY
  27. NOTE "Enter the library code or page number to use:"
  28. NOTE
  29. NOTE "             ST   for ST RT Library"
  30. NOTE "             AL   for ST Aladdin RT Library"
  31. NOTE "             GL   for GEnie Library "
  32. ;add additional library letter lists here and also below where indicated
  33. NOTE
  34. NOTE "Enter library to use:"
  35. GETSTRING 1                            Library to use
  36. IF SUCCESS                             ESC not pressed
  37.   IF STRING 1 IS ""                    Blank string entered
  38.      NOTE
  39.      NOTE "  Blank line entered try again."
  40.      NOTE
  41.      GOTO ENTER_LIBRARY                Try again.
  42.   ENDIF
  43. ELSE                                   ESC pressed
  44.   CLEAR                                Clear the screen
  45.   NOTE
  46.   NOTE "Script aborted."
  47.   GOTO EXIT                            Exit script
  48. ENDIF
  49. IF STRING 1 IS "AL"                    ST Aladdin Library selected
  50.   SETSTRING 1 "1000;3"                 Download Aladdin Library file
  51.   GOTO ENTER_FILES
  52. ENDIF
  53. IF STRING 1 IS "al"                    ST Aladdin Library selected
  54.   SETSTRING 1 "1000;3"                 Download Aladdin Library file
  55.   GOTO ENTER_FILES
  56. ENDIF
  57. IF STRING 1 IS "ST"                    ST RT Library selected
  58.   SETSTRING 1 "475;3"                  Download ST Library file
  59.   GOTO ENTER_FILES
  60. ENDIF
  61. IF STRING 1 IS "st"                    ST RT Library selected
  62.   SETSTRING 1 "475;3"                  Download ST Library file
  63.   GOTO ENTER_FILES
  64. ENDIF
  65. ;the next if statements are for adding a new library
  66. IF STRING 1 IS "GL"                    use this for first library added
  67.   SETSTRING 1 "1075;4"                 enter the page number of the RT
  68.   GOTO ENTER_FILES
  69. ENDIF
  70. IF STRING 1 IS "gl"                    use lower case letters here
  71.   SETSTRING 1 "1075;4"                 enter the same page number
  72.   GOTO ENTER_FILES
  73. ENDIF
  74. ;Additional RTs can be added by repeating the IF statements above with the
  75. ;appropriate identifying letters.
  76.  
  77. ;This is based on all RTs having option 3 as library and option 6 as download
  78. ; except for page 1075 which has Library Option under #4, Actual Library
  79. ; Menu is the same as regular RTs.
  80. SETSTRING 1 "%1;3"                     Set Library download option
  81. :ENTER_FILES 
  82. NOTE 
  83. NOTE "Enter the file name(s) or number(s) to download. 75 characters max."
  84. NOTE "Multiple files must be separated by commas.  ESC to exit."
  85. NOTE "___________________________________________________________________________" 
  86. GETSTRING 2                            File(s) to download 
  87. IF SUCCESS                             ESC not pressed
  88.   IF STRING 2 IS ""                    Blank string entered
  89.      NOTE
  90.      NOTE "  Blank line entered try again."
  91.      NOTE
  92.      GOTO ENTER_FILES                  Try again.
  93.   ENDIF
  94. ELSE                                   ESC pressed
  95.   CLEAR                                Clear the screen
  96.   NOTE
  97.   NOTE "Script aborted."
  98.   GOTO EXIT                            Exit script
  99. ENDIF
  100. IF STRING 2 HAS ","                    multiple file download
  101.    GOTO MULTIPLE                       skip to multiple file routine
  102. ENDIF                                  continue with single file download
  103. NOTE
  104. NOTE "Enter the file name for the description.  RETURN with no name to"
  105. NOTE "not save the file description.  (No check for illegal file names)."
  106. NOTE "If a path is entered with the file name it will be used. (ie A:\)"
  107. NOTE "If no path is entered the default path will be used."
  108. NOTE "Duplicate file names will be appended.  ESC to exit."
  109. NOTE
  110. NOTE "Enter description file name (RETURN for none):"
  111. GETSTRING 3                            Description file name
  112. IF SUCCESS                             ESC not pressed
  113.    :SINGLE
  114.    LOG ONTO "%1"                       Logon to Library
  115.    IF SUCCESS                          Logon successful
  116.       SENDLINE "6"                     Download option
  117.       WAITFORPROMPT                    Wait for file number request
  118.       SENDLINE "%2"                    Send file number to download
  119.       IF STRING 3 IS ""                Blank string entered
  120.          GOTO DOWNLOAD                 Skip saving file description
  121.       ENDIF
  122.       IF STRING 3 HAS "\"              Path entered with file name
  123.         CAPTURE "%3"                   Use entered path and file name
  124.       ELSE                             No path entered use default path
  125.         ;For a default path use the line below instead of CAPTURE "%3"
  126.         ;CAPTURE "DRIVE:\FOLDER1\FOLDER2\%3"
  127.         CAPTURE "%3"                   Open description file capture
  128.       ENDIF
  129.       :DOWNLOAD
  130.       WAITFORPROMPT                    Ready for download 
  131.       IF CURRENTLINEHAS "Again"        File not found
  132.          SENDLINE "N"                  don't try again
  133.          WAITFORPROMPT
  134.          ENDCAPTURE                    Close description file if open
  135.          LOG OFF                       Log off GEnie
  136.          NOTE
  137.          NOTE
  138.          NOTE "************************************************"
  139.          NOTE "     File %2 not in this Library."
  140.          NOTE "************************************************"
  141.          GOTO EXIT                     Quit script
  142.       ELSE
  143.          SENDLINE "D"                  Tell GEnie ready to download
  144.          ENDCAPTURE                    Close description file capture, if open 
  145.          WAITFOR "skip?"               type download prompt 
  146.          SENDLINE "4"                  download using Zmodem 
  147.          ;if a download path is desired other than the location of the
  148.          ;Aladdin program, place the path in the next line and delete the ;
  149.          ;ZMODEM DOWNLOAD DRIVE:\FOLDER1\FOLDER2\ path for downloaded files 
  150.          WAITFORPROMPT                 download another file prompt 
  151.          SENDLINE "n"                  don't download any more files 
  152.          WAITFORPROMPT                 Ready to log off 
  153.       ENDIF
  154.    ELSE                                Logon failed (busy)
  155.       NOTE "Log on failed.  Enter Y to try again, anything else to exit."
  156.       NOTE "ESC will abort script at any time."
  157.       GETSTRING 4                      Try again?
  158.       IF STRING 4 IS "Y"               Try again!
  159.          GOTO SINGLE
  160.       ENDIF
  161.       IF STRING 4 IS "y"               Try again!
  162.          GOTO SINGLE
  163.       ENDIF
  164.    ENDIF
  165. ELSE                                   ESC pressed
  166.    CLEAR                               Clear the screen
  167.    NOTE
  168.    NOTE "Script aborted."
  169.    GOTO EXIT                           Exit script
  170. ENDIF                                  File downloaded
  171. GOTO LOG_OFF                           Script done log off
  172.  
  173. ;Multiple file download
  174.  
  175. :MULTIPLE
  176. LOG ONTO "%1"                          Log on to RT Library
  177. IF SUCCESS                             Log on made
  178.    SENDLINE "6"                        Select download
  179.    WAITFORPROMPT                       Wait for download request
  180.    ;If a default path is desired use the line below instead of
  181.    ;  CAPTURE "DLERROR.TXT".  Be sure to provide the same path for the
  182.    ;  ERASEFILE commands above and below.
  183.    ;CAPTURE "DRIVE:\FOLDER1\FOLDER2\DLERROR.TXT"
  184.    CAPTURE DLERROR.TXT                 File not found text file
  185.    SENDLINE "%2"                       Send file numbers to download
  186.    WAITFORPROMPT                       Ready for download type
  187.    IF CURRENTLINEHAS "Again"           File not found
  188.       SENDLINE "N"                     don't try again
  189.       WAITFORPROMPT
  190.       ENDCAPTURE                       Close error file
  191.       LOG OFF                          Log off GEnie
  192.       NOTE
  193.       NOTE
  194.       NOTE "**********************************************************"
  195.       NOTE " One or more files in the list below not in this Library."
  196.       NOTE " %2"
  197.       NOTE " Browse DLERROR.TXT to see the first file not found."
  198.       NOTE "**********************************************************"
  199.       GOTO EXIT                        Quit script
  200.    ELSE                                Files found
  201.       ENDCAPTURE
  202.       SENDLINE "Z"                     zmodem
  203.       ;If a download path is desired other than the location of the Aladdin
  204.       ;program, place the path in the next line and delete the ;
  205.       ;ZMODEM DOWNLOAD DRIVE:\FOLDER1\FOLDER2\  download path
  206.       WAITFORPROMPT                    Download complete
  207.       SENDLINE "n"                     No more files to download
  208.       WAITFORPROMPT                    Ready to logoff
  209.    ENDIF
  210. ELSE                                   Log on failed (busy)
  211.    NOTE "Log on failed.  Enter Y to try again, anything else to exit."
  212.    NOTE "ESC will abort script at any time."
  213.    GETSTRING 4                         Try again?
  214.    IF STRING 4 IS "Y"                  Try again!
  215.       GOTO MULTIPLE
  216.    ENDIF
  217.    IF STRING 4 IS "y"                  Try again!
  218.       GOTO MULTIPLE
  219.    ENDIF
  220. ENDIF
  221. :LOG_OFF
  222. LOG OFF                                Logoff GEnie
  223. IF EXIST "E:\GENIE\DOWNLOAD\DLERROR.TXT"              
  224.    ;if the DLERROR.TXT path was changed above, provide the same path here
  225.    ;ERASEFILE "DRIVE:\FOLDER1\FOLDER2\DLERROR.TXT"
  226.    ERASEFILE "E:\GENIE\DOWNLOAD\DLERROR.TXT" Erase error file, no error
  227. ENDIF
  228. :EXIT                                  Exit script
  229. BEEP                                   Sound bell
  230. ENDSCRIPT
  231.  
  232.  
  233.